<template>
  <rx-dialog @handOk="handleSubmit" @cancel="cancel">
    <a-form :form="form">
      <a-form-item style="display:none">
        <a-input v-decorator="['id']"/>
      </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.modelDefine','业务模型定义')">
					<a-input :placeholder="i18n('form.modelDefine','业务模型定义')" v-decorator="['bodefId', {rules: [{required: false, message: i18n('form.modelDefine','业务模型定义','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.entityID','实体ID')">
					<a-input :placeholder="i18n('form.entityID','实体ID')" v-decorator="['entId', {rules: [{required: false, message: i18n('form.entityID','实体ID','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.parentID','父实体ID')">
					<a-input :placeholder="i18n('form.parentID','父实体ID')" v-decorator="['parentEntId', {rules: [{required: false, message: i18n('form.parentID','父实体ID','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.relType','关系类型')+'(onetoone,onetomany)'">
					<a-input :placeholder="i18n('form.relType','关系类型')+'(onetoone,onetomany)'" v-decorator="['type', {rules: [{required: false, message: i18n('form.relType','关系类型','select') +'(onetoone,onetomany)'}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.reference','是否引用')">
                    <a-input-number :min="0" :max="1000000" :placeholder="i18n('form.reference','是否引用')" v-decorator="['isRef', {rules: [{required: false, message: i18n('form.reference','是否引用','select')}]}]" />
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.keyField','主键字段')">
					<a-input :placeholder="i18n('form.keyField','主键字段')" v-decorator="['pkField', {rules: [{required: false, message: i18n('form.keyField','主键字段','input')}]}]"/>
			  </a-form-item>
			  <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="i18n('form.assoField','关联字段')">
					<a-input :placeholder="i18n('form.assoField','关联字段')" v-decorator="['fkField', {rules: [{required: false, message: i18n('form.assoField','关联字段','input')}]}]"/>
			  </a-form-item>
    </a-form>
  </rx-dialog>
</template>
<script>
  import FormBoRelationApi from '@/api/form/bo/formBoRelation'
  import {BaseForm,RxDialog} from "@lowcode/jpaas-common-lib";
  export default {
    name: 'FormBoRelationEdit',
    mixins:[BaseForm],
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"formIndexManager",key);
        },
      getById(id){
        return FormBoRelationApi.get(record.pkId);
      },
      save(values){
          return FormBoRelationApi.save(values);
      }
    }
  }
</script>
